Post

Replies

Boosts

Views

Activity

Reply to "applicationWillTerminate" not called
OK. I did the followings; class AppDelegate: NSObject, UIApplicationDelegate { private var isTaskKilled = true func applicationDidEnterBackground(_ application: UIApplication) { isTaskKilled = false } func applicationWillEnterForeground(_ application: UIApplication) { if isTaskKilled { // Do something when task killed. } } }
Topic: Design SubTopic: General Tags:
Sep ’24
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Thank you for your response. Please let me tell you another additional information, which is, I use SwiftUI. Please let me answer your questions as follow; The following is the code I use; private var context = LAContext() public func checkBiometric() -> Future<Bool, Error> { Future { [context] promise in Task { [promise, context] in context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Some reason") { success, error in if success { promise(.success(success)) } else { promise(.failure(error as! LAError)) } } } } } This is called right after lifecycle status becomes "active" from "background". The test device is iPhone 13 pro with iOS 15.5, and Face ID. If you need more information, please feel free to contact me. Best regards,
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Additional information, Biometrics authentication works when first login to my iOS app. Finish app and go to background Activate app to get back from background. Biometrics authentication works but always returns "success" It works fine at 1. operation because it is the very first Biometrics authentication. On the other hand, it always returns "success" from 2nd trial. If I terminate the app and re-activate it, Biometrics authentication works fine. Therefore, I wonder if Biometrics authentication would not work correctly when get back from background.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to Special camera application issue
ssmith_c, sorry for my late response. Thank you for your response. Yes, I understand what you are saying and you are right. I can get much better picture when I record a video, but can not get the same quality for a still picture. So, I think the problem shows when I shoot a still picture. The reason may be less light, though.
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’22
Reply to AutoLayout constraint reset after tableView cell is created.
The following is a part of my code; func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { ... if let url = URL(string: urlString) { cell.imageView.sd_setImage(with: url, completed: { image, error, _, _ in if let error = error { print(error) return } if let image = image { let imageAspect = image.size.height / image.size.width cell.imageViewHeightConstraint.constant = tableView.frame.width * imageAspect tableView.reloadRows(at: [indexPath], with: .none) } }) } ... } I tried to call setNeedsLayout on the cell by replacing tableView.reloadRows(at: [indexPath], with: .none) with cell.setNeedsLayout(), it did not work. Anyway, thank you for your information.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’22
Reply to "applicationWillTerminate" not called
OK. I did the followings; class AppDelegate: NSObject, UIApplicationDelegate { private var isTaskKilled = true func applicationDidEnterBackground(_ application: UIApplication) { isTaskKilled = false } func applicationWillEnterForeground(_ application: UIApplication) { if isTaskKilled { // Do something when task killed. } } }
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’24
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Thank you for your response. Please let me tell you another additional information, which is, I use SwiftUI. Please let me answer your questions as follow; The following is the code I use; private var context = LAContext() public func checkBiometric() -> Future<Bool, Error> { Future { [context] promise in Task { [promise, context] in context.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Some reason") { success, error in if success { promise(.success(success)) } else { promise(.failure(error as! LAError)) } } } } } This is called right after lifecycle status becomes "active" from "background". The test device is iPhone 13 pro with iOS 15.5, and Face ID. If you need more information, please feel free to contact me. Best regards,
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to LAPolicy.deviceOwnerAuthenticationWithBiometrics always returns "success" when back from background.
Additional information, Biometrics authentication works when first login to my iOS app. Finish app and go to background Activate app to get back from background. Biometrics authentication works but always returns "success" It works fine at 1. operation because it is the very first Biometrics authentication. On the other hand, it always returns "success" from 2nd trial. If I terminate the app and re-activate it, Biometrics authentication works fine. Therefore, I wonder if Biometrics authentication would not work correctly when get back from background.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to Special camera application issue
ssmith_c, sorry for my late response. Thank you for your response. Yes, I understand what you are saying and you are right. I can get much better picture when I record a video, but can not get the same quality for a still picture. So, I think the problem shows when I shoot a still picture. The reason may be less light, though.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’22
Reply to AutoLayout constraint reset after tableView cell is created.
The following is a part of my code; func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { ... if let url = URL(string: urlString) { cell.imageView.sd_setImage(with: url, completed: { image, error, _, _ in if let error = error { print(error) return } if let image = image { let imageAspect = image.size.height / image.size.width cell.imageViewHeightConstraint.constant = tableView.frame.width * imageAspect tableView.reloadRows(at: [indexPath], with: .none) } }) } ... } I tried to call setNeedsLayout on the cell by replacing tableView.reloadRows(at: [indexPath], with: .none) with cell.setNeedsLayout(), it did not work. Anyway, thank you for your information.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22